package com.sq.partner.manager.service.credit;

import java.util.List;
import java.util.Map;

import org.springframework.ui.ModelMap;

import com.sq.partner.manager.common.Result;
import com.sq.partner.manager.mybatis.model.CoreDept;
import com.sq.partner.manager.mybatis.model.CreditPlan;
import com.sq.partner.manager.mybatis.model.CreditProduct;
import com.sq.partner.manager.mybatis.model.GatewayChannelInfo;
import com.sq.partner.manager.mybatis.model.NlifePlan;
import com.sq.partner.manager.mybatis.model.NlifeProd;
import com.sq.partner.manager.mybatis.model.TradAgentInfo;
import com.sq.partner.manager.mybatis.model.TradAgentInfoRela;
import com.sq.partner.manager.mybatis.model.credit.credit10008;
import com.sq.partner.manager.util.Page;

public interface CreditPlanService {
	
	/**
	 * 分页条件查询合作伙伴
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<GatewayChannelInfo> queryChannelInfoPageByCriteria(Page<GatewayChannelInfo> page) throws Exception;
	
	/**
	 * 分页条件查询方案
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<Map<String,Object>> queryPlanListByCriteria(Page<Map<String,Object>> page) throws Exception;
	
	/**
	 * 跳转新增方案页面前准备数据
	 * @param modelMap
	 * @throws Exception
	 */
	public void toAddCreditPlan(ModelMap modelMap) throws Exception;
	
	/**
	 * 加载  编辑方案页面数据
	 * @param plan_code
	 * @return
	 * @throws Exception
	 */
	public Map<String,Object> loadCreditPlan(String plan_code) throws Exception;
	/**
	 * 查询客户信息（个人）
	 * @param identifyNo
	 * @return
	 */
	public credit10008 queryCustBy(credit10008 credit10008,String href)throws Exception;
	/**
	 * 更新方案关联的个人代理信息
	 * @param userid
	 * @param plan_code
	 * @param agentInfoListStr
	 * @return
	 * @throws Exception
	 */
	public Result updateAgentInfoRela(String agentType,List<String> list,Long userid, String plan_code,
			String agentInfoListStr) throws Exception;
	
	/**
	 * 分页条件查询信保产品
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<CreditProduct> queryCreditProdPageByCriteria(Page<CreditProduct> page) throws Exception;

	/**
	 * 分页条件查询出单机构
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page<CoreDept> queryDeptPageByCriteria(Page<CoreDept> page) throws Exception;
	
	/**
	 * 加载个人代理、总对总代理信息
	 * @param page
	 * @param agentType
	 * @return
	 * @throws Exception
	 */
	public Page<Map<String,Object>> queryAgentInfoPageByCriteria(Page<Map<String,Object>> page, String agentType) throws Exception;

	/**
	 * 加载方案关联个人代理、总对总代理信息
	 * @param page
	 * @param agentType
	 * @return
	 * @throws Exception
	 */
	public Page<Map<String,Object>> queryAgentInfoRelaPageByCriteria(Page<Map<String,Object>> page, String agentType) throws Exception;

	
	/**
	 * 区域总对总代理信息
	 * @param page
	 * @param agentType
	 * @return
	 * @throws Exception
	 */
	public Page<Map<String,Object>> queryAgentInfoZon4PageByCriteria(Page<Map<String,Object>> page) throws Exception;

	/**
	 * 新增区域总对总方案关联
	 * @param nlifePlan
	 * @param nlifeProd
	 * @return
	 * @throws Exception
	 */
	public Result addZonTradInfo(List<TradAgentInfoRela> list,Map<String, Object> map,boolean isTradSale) throws Exception;
	
	/**
	 * 新增方案
	 * @param nlifePlan
	 * @param nlifeProd
	 * @return
	 * @throws Exception
	 */
	public Result addCreditPlan(CreditPlan creditPlan,CreditProduct creditProd) throws Exception;
	
	/**
	 * 复制新增方案
	 * @param oldplan_code
	 * @param nlifePlan
	 * @param nlifeProd
	 * @return
	 * @throws Exception
	 */
	public Result copyAddCreditPlan(String oldplan_code,String oldPartnerNo,String oldAgentType, CreditPlan creditPlan,CreditProduct creditProd) throws Exception;
	
	/**
	 * 修改方案
	 * @param nlifePlan
	 * @param nlifeProd
	 * @return
	 * @throws Exception
	 */
	public Result updateCreditPlan(CreditPlan creditPlan,CreditProduct creditProd) throws Exception;
	
	/**
	 * 跳转编辑方案页面前准备数据
	 * @param modelMap
	 * @throws Exception
	 */
	public void toEditCreditPlan(ModelMap modelMap,String plan_code) throws Exception;

	/**
	 * 跳转复制新增方案页面前准备数据
	 * @param modelMap
	 * @throws Exception
	 */
	public void toCopyAddCreditPlan(ModelMap modelMap,String plan_code) throws Exception;

	/**
	 * 删除方案
	 * @return
	 * @throws Exception
	 */
	public Result delCreditPlan(CreditPlan creditPlan) throws Exception;
	
	/**
	 * 根据plan_code查询对应方案
	 * @param plan_code
	 * @return
	 * @throws Exception
	 */
	public CreditPlan queryById(String plan_code) throws Exception;
	
	/**
	 * 删除区域总对总信息
	 * @return
	 * @throws Exception
	 */
	public Boolean delZonTradInfo(Map<String, Object> map) throws Exception;

	/**
	 * 根据prod_code查询对应方案
	 * @param prod_code
	 * @return
	 * @throws Exception
	 */
	public boolean queryByProdId(String prod_code) throws Exception;
	
	/**导出方案查询*/
	public List<CreditPlan> impCreditPlan(Map<String, Object>map) throws Exception;
}
